package com.idata.model.response;

import com.idata.model.proxyDO.KGRecommendPersonDO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CitizenSearchResponse {

    private CitizenResponse citizenInfo;
    private List<PhoneInfoResponse> phoneList = new ArrayList<>();
    private List<TagResponse> tagList = new ArrayList<>();
    private List<DisputeRelationResponse> relationList = new ArrayList<>();
    private List<DisputeWordResponse> disputeWordList = new ArrayList<>();

    public static CitizenSearchResponse convertFromKGRecommendPerson(KGRecommendPersonDO kgRecommendPersonDO) {
        CitizenResponse citizenResponse = new CitizenResponse();
        BeanUtils.copyProperties(kgRecommendPersonDO, citizenResponse);
        citizenResponse.setDisputeTotalCount(kgRecommendPersonDO.getDisputeCount());
        return new CitizenSearchResponse().setCitizenInfo(citizenResponse);
    }

    // shit code
    // 纠纷总数
    private Integer disputeTotalCount;

    // 110警情数
    private Integer police110Count;

    // 协同办案数
    private Integer collaborativeCaseCount;

    // 高危数
    private Integer highRiskCount;
}
